module.exports = (sequelize, DataTypes) => {

    const userModel = sequelize.define('user', {
      uid:{
        type:DataTypes.INTEGER,
        allowNull:false,
        field:'uid',
        autoIncrement: true,
        primaryKey: true
      },
      identity:{
        type: DataTypes.ENUM('普通用户','员工'),
        allowNull: false
      },
      tel:{
        type: DataTypes.INTEGER,
        allowNull: true,
        validate: {
            len: [11, 11]
          }
      },
      real_name: {
        type: DataTypes.STRING,
        allowNull: true,
      },
      area: {
        type: DataTypes.STRING,
        allowNull: true,
      },
    },{
      tableName: 'user_info',
      timestamps:false
    })
    return userModel;
  }
